#ifndef __UTILITY_HPP__
#define __UTILITY_HPP__

#include <iostream>
#include <string>
#include <vector>
#include <cstring>

#define SEP "X"
#define SEP_LEN strlen(SEP)

#define SPACE " "
#define SPACE_LEN strlen(SPACE)

void SpliteMessage(std::string& buffer,std::vector<std::string>* out)
{
    while(true)
    {
        size_t pos=buffer.find(SEP);
        if(pos==std::string::npos)
        {
            break;
        }

        std::string message=buffer.substr(0,pos);
        out->push_back(message);
        buffer.erase(0,pos+SPACE_LEN);
    }
}

#endif